import {getSite} from "../../../../../service/site";

const app = getApp()
const global = app.globalData

Component({
    options:{
        styleIsolation: 'apply-shared',
    },
    properties: {
        defaultValue:{
            type:[Boolean], value:'',
            observer:function (data) {
                this.setData({
                    checked:data ? true : false,
                })
            }
        },
        pointsPrice:{
            type:Number, value:0,
        },
        site:{type:Object, value:null}
    },
    data: {
        imageUrl:global.imageUrl,
        checked:false,
    },
    lifetimes:{
        attached() {

        }
    },
    methods: {
        onChange(e){
            const {checked} = e.detail
            this.setData({
                checked,
            })
            this.triggerEvent("change", {
                value: checked
            })
        }
    }
});
